package 笔试.腾讯;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @author:谢君臣
 * @Date:2021/9/5-21:26
 * @version:1.0
 * @function:
 */
public class Main9504 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int l = scanner.nextInt();
        int r = scanner.nextInt();
        int result = 0;
        List<Integer> list = new ArrayList<>();
        list.add(n / 2);
        list.add(n % 2);
        list.add(n / 2);
        int i = 0;
        while (i < list.size()) {
            if (list.get(i) > 1) {
                int temp = list.remove(i);
                list.add(i, temp / 2);
                list.add(i, temp % 2);
                list.add(i, temp / 2);
            } else i++;

        }
        for (i = l - 1; i < r; i++) {
            if (list.get(i) == 1) result++;
        }
        System.out.println(result);
    }

}
